package co.fitstart.entity.courseware.dietary;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * 
 * @author dan
 *
 */
@Entity
@Table(name = "dietary_program_template")
@JsonIgnoreProperties(value={"hibernate_lazy_initializer","handler","fieldHandler"})
public class DietaryProgramTemplate {
    
    @Id
    @GeneratedValue
    private Long id;
    
    /** 名称 */
    private String name;
    
    /** 描述 */
    @Type(type = "text")
    @JSONField(serialize = false)
    private String description;
    
    /** 加餐 */
    private Long snacks;
    
    /** 类型 */
    @Enumerated(EnumType.ORDINAL)
    private DietaryProgramType type;
    
    @Column(name = "is_disabled")
    private boolean disabled;
    
    /**
     * The default constructor
     */
    public DietaryProgramTemplate() {
        
    }
    
    /**
     * 
     * @return
     */
    public DietaryProgramTemplate disable() {
        this.disabled = true;
        return this;
    }
    
    /**
     * 
     * @param snacks
     * @return
     */
    public DietaryProgramTemplate editSnacks(Long snacks) {
        this.snacks = snacks;
        return this;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the snacks
     */
    public Long getSnacks() {
        return snacks;
    }

    /**
     * @return the type
     */
    public DietaryProgramType getType() {
        return type;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @param snacks the snacks to set
     */
    public void setSnacks(Long snacks) {
        this.snacks = snacks;
    }

    /**
     * @param type the type to set
     */
    public void setType(DietaryProgramType type) {
        this.type = type;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

}
